package com.formiaomiao.demain.config;

import com.formiaomiao.demain.model.JwtFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class JwtCfg {

    @Bean
    public FilterRegistrationBean jwtFilter() {
        final FilterRegistrationBean registrationBean = new FilterRegistrationBean();
        registrationBean.setFilter(new JwtFilter());
        registrationBean.addUrlPatterns("/user/updateHead");
        registrationBean.addUrlPatterns("/user/updatePwd");
        registrationBean.addUrlPatterns("/user/updateNickName");
        registrationBean.addUrlPatterns("/demain/selectDemain");
        registrationBean.addUrlPatterns("/demain/insertDemain");
        registrationBean.addUrlPatterns("/demain/deleteDemain");
        registrationBean.addUrlPatterns("/demain/selectAllDemain");
        registrationBean.addUrlPatterns("/opinion");
        registrationBean.addUrlPatterns("/follow");
        registrationBean.addUrlPatterns("/like");
        registrationBean.addUrlPatterns("/comment");
        registrationBean.addUrlPatterns("/friend");
        registrationBean.addUrlPatterns("/insertcomplaint");
        registrationBean.addUrlPatterns("/updateremarks");
        return registrationBean;
    }
}
